-- card: 5771 from stack: in.3 -- bmap block id: 0 -- flags: 4000 -- background id: 3241 -- name: HyperFolder ----- HyperTalk script ----- on Install get ChooseTargetStack() InstallResource XFCN,HyperFolder,it end Install -- part 1 (button) -- low flags: 00 -- high flags: A003 -- rect: left=80 top=300 right=322 bottom=180 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: HyperFolder ----- HyperTalk script ----- on mouseUp answer HyperFolder() end mouseUp -- part 2 (button) -- low flags: 00 -- high flags: A003 -- rect: left=299 top=300 right=322 bottom=438 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Show Pascal Source ----- HyperTalk script ----- on mouseUp set the visible of card field 1 to not the visible of card field 1 if the visible of card field 1 is true then set the name of me to "Hide Pascal Source" else set the name of me to "Show Pascal Source" end mouseUp -- part 3 (field) -- low flags: 81 -- high flags: 2007 -- rect: left=12 top=26 right=298 bottom=491 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 22 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Source -- part contents for background part 16 ----- text ----- HYPERFOLDER XFCN version 1.0.1 Kevin Calhoun HyperFolder returns the pathname of the folder that contains the copy of HyperCard that's currently running, appended by a colon. I'm not sure what it's good for, but I thought I'd throw it in here anyway, just to keep the SystemFolder XFCN company. 22 July 1989 -- Declares the directory ID as a longint in the parameter list of DirIDToPath. -- part contents for card part 3 ----- text ----- UNIT HooperFolder; { HyperFolder XFCN ©1989 by the Trustees of Dartmouth College } { Written by Kevin Calhoun } { This source compatible with MPW Pascal 3.0 } (* pascal HyperFolder.p Link -m ENTRYPOINT ∂ -o "YourFile" ∂ -rt XFCN=970 ∂ -sn Main=HyperFolder ∂ HyperFolder.p.o ∂ "{Libraries}"interface.o ∂ "{PLibraries}"PasLib.o ∂ "{Libraries}"HyperXLib.o *) {$R-} INTERFACE USES Types, Memory, Files, Packages, HyperXCmd; PROCEDURE EntryPoint (paramPtr : XCMDPtr); IMPLEMENTATION PROCEDURE HyperFolder (paramPtr : XCMDPtr); FORWARD; PROCEDURE EntryPoint (paramPtr : XCMDPtr); BEGIN HyperFolder(paramPtr); END; PROCEDURE DirIDToPath(paramPtr: XCMDPtr; dirID: LONGINT; vRefNum: INTEGER; VAR path: Str255); VAR result: INTEGER; str: Str255; pb: CInfoPBRec; BEGIN path := ''; ZeroBytes(paramPtr,@pb,SizeOf(pb)); pb.ioDirID := dirID; WHILE pb.ioDirID <> 1 DO BEGIN pb.ioNamePtr := @str; pb.ioFDirIndex := -1; pb.ioVRefNum := vRefNum; IF PBGetCatInfo(@pb,FALSE) <> noErr THEN Exit(DirIDToPath); path := Concat(str,':',path); pb.ioDirID := pb.ioDrParID; END; END; FUNCTION CurApRefNum: INTEGER; CONST appRefNum = $900; TYPE WordPtr = ^INTEGER; VAR myWord: WordPtr; BEGIN myWord := WordPtr(appRefNum); CurApRefNum := myWord^; END; PROCEDURE HyperFolder(paramPtr: XCMDPtr); VAR err: OSErr; myFCBPBRec: FCBPBRec; s: Str255; BEGIN ZeroBytes(paramPtr, @myFCBPBRec, SIZEOF(FCBPBRec)); with myFCBPBRec DO BEGIN ioCompletion := NIL; ioNamePtr := NIL; ioRefNum := CurApRefNum; ioFCBIndx := 0; END; err := PBGetFCBInfo(@myFCBPBRec, FALSE); IF err = noErr THEN DirIDToPath(paramPtr, myFCBPBRec.ioFCBParID, myFCBPBRec.ioFCBVRefNum, s); IF err <> noErr THEN BEGIN NumToStr(paramPtr, err, s); s := CONCAT('Error ', s); END; paramPtr^.returnValue := PasToZero(paramPtr, s); END; END.